package com.example.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;

import com.example.beans.User;

/**
 * 直接在接口上添加sql註解的方式 注入dao到bean容器中
 * @author jiaqi.liu
 *
 */
@Repository
@Mapper
public interface UserRepository {
	
	
	@Select("SELECT name,age FROM user WHERE name=#{name}")
	public User getUserByName(@PathVariable("name") String name) throws Exception;

}
